extends layout

block content
    .panel.panel-primary
        if !loginAbout.isLogin
            .modal.fade#myModal(tabindex="-1",role="dialog",aria-labelledby="myModalLabel")
                .modal-dialog(role="document")
                    .modal-content
                        .modal-header
                            button.close(type="button",data-dismiss="modal",aria-label="Close")
                                span(aria-hidden="true") &times;
                            h4.modal-title#myModalLabel 用户注册
                        .modal-body
                            form#reg-form(method='post',action='/users/register')
                                .panel-body.form-horizontal
                                    .form-group.col-md-12
                                        label.col-sm-2.control-label(for='username') 用户名:
                                        .col-md-10
                                            input.form-control(type='text', name='username')
                                    .form-group.col-md-12
                                        label.col-sm-2.control-label(for='email') 邮箱:
                                        .col-md-10
                                            input.form-control(type='text', name='email')
                                    .form-group.col-md-12
                                        label.col-md-2.control-label(for='password') 密码:
                                        .col-md-10
                                            input.form-control(type='password', name='password')
                        .modal-footer
                            span#register-error
                            | &nbsp;&nbsp;
                            button.btn.btn-default(type="button",data-dismiss="modal") 取消
                            button.btn.btn-default#toregister(type="button") 注册
            .panel-heading
                h3.panel-title 上传图片需要登录哦！
            form#login-form(method='post',action='/users/login')
                .panel-body.form-horizontal
                    .form-group.col-md-12
                        label.col-sm-2.control-label(for='username') 用户名:
                        .col-md-10
                            input.form-control(type='text', name='username')
                    .form-group.col-md-12
                        label.col-md-2.control-label(for='password') 密码:
                        .col-md-10
                            input.form-control(type='password', name='password')
                    .form-group.col-md-12
                        .col-md-12.text-right
                            span#login-error
                            | &nbsp;&nbsp;
                            button#register-btn.btn.btn-default(type='button',data-toggle='modal',data-target='#myModal')
                                i.fa.fa-user  注册
                            | &nbsp;&nbsp;
                            button#login-btn.btn.btn-success(type='button')
                                i.fa.fa-sign-in  登录
        else
            .panel-heading
                h3.panel-title 上传图片
            form(method='post', action='/images', enctype='multipart/form-data')
                .panel-body.form-horizontal
                    .form-group.col-md-12
                        label.col-sm-2.control-label(for='file') 浏览:
                        .col-md-10
                            input.form-control(type='file', name='file')
                    .form-group.col-md-12
                        label.col-md-2.control-label(for='title') 标题:
                        .col-md-10
                            input.form-control(type='text', name='title')
                    .form-group.col-md-12
                        label.col-md-2.control-label(for='description') 描述:
                        .col-md-10
                            textarea.form-control(name='description', rows='3')
                    .form-group.col-md-12
                        .col-md-12.text-right
                            button#login-btn.btn.btn-success(type='submit')
                                i.fa.fa-cloud-upload 上传
    .panel.panel-default
        .panel-heading
            .h3.panel-title 最新图片
        .panel-body
            each img in images
                .col-md-4.text-center.imageboxDiv
                    a(href=`/images/${img.id}`)
                        img.img-thumbnail.imagebox(src=`/upload/${img.filename}`,alt=img.title)
